/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
using System;
using System.Collections.Generic;

using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.CSB.Model.V20171118;

namespace Aliyun.Acs.CSB.Transform.V20171118
{
    public class FindAllLinkRuleResponseUnmarshaller
    {
        public static FindAllLinkRuleResponse Unmarshall(UnmarshallerContext context)
        {
			FindAllLinkRuleResponse findAllLinkRuleResponse = new FindAllLinkRuleResponse();

			findAllLinkRuleResponse.HttpResponse = context.HttpResponse;
			findAllLinkRuleResponse.Code = context.IntegerValue("FindAllLinkRule.Code");
			findAllLinkRuleResponse.Message = context.StringValue("FindAllLinkRule.Message");
			findAllLinkRuleResponse.RequestId = context.StringValue("FindAllLinkRule.RequestId");

			FindAllLinkRuleResponse.FindAllLinkRule_Data data = new FindAllLinkRuleResponse.FindAllLinkRule_Data();

			List<FindAllLinkRuleResponse.FindAllLinkRule_Data.FindAllLinkRule_LinkRuleListItem> data_linkRuleList = new List<FindAllLinkRuleResponse.FindAllLinkRule_Data.FindAllLinkRule_LinkRuleListItem>();
			for (int i = 0; i < context.Length("FindAllLinkRule.Data.LinkRuleList.Length"); i++) {
				FindAllLinkRuleResponse.FindAllLinkRule_Data.FindAllLinkRule_LinkRuleListItem linkRuleListItem = new FindAllLinkRuleResponse.FindAllLinkRule_Data.FindAllLinkRule_LinkRuleListItem();
				linkRuleListItem.CsbId = context.LongValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].CsbId");
				linkRuleListItem.OwnerId = context.StringValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].OwnerId");
				linkRuleListItem.GmtCreate = context.LongValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].GmtCreate");
				linkRuleListItem.GmtModified = context.LongValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].GmtModified");
				linkRuleListItem.Id = context.LongValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].Id");
				linkRuleListItem.Deleted = context.IntegerValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].Deleted");
				linkRuleListItem.OriginName = context.StringValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].OriginName");
				linkRuleListItem.TargetName = context.StringValue("FindAllLinkRule.Data.LinkRuleList["+ i +"].TargetName");

				data_linkRuleList.Add(linkRuleListItem);
			}
			data.LinkRuleList = data_linkRuleList;
			findAllLinkRuleResponse.Data = data;
        
			return findAllLinkRuleResponse;
        }
    }
}
